#定义Cat类
class Cat:
    age = 2 #年龄属性
    name = "小白"#名字属性
    color = "白色" #颜色属性

# cat1 = Cat()
# print(f"age : {cat1.age} name : {cat1.name} color : {cat1.color}")



class Person:
    age = None
    name = None

# p1 = Person()
# p1.age = 10
# p1.name = "小明"
# p2 = p1 #把p1赋值给了p2,让p2指向p1
# print(p2.age)#10
# print(f"p1.name的地址是{id(p1.name)} p2.name的地址是{id(p2.name)}")


a = Person()
a.age = 10
a.name = "jack"
b = a
print(b.name)#jack
b.age = 200
b = None
print(a.age)#200
print(b.age)#报错